<?php
    class Security
    {	
        public static function getLeoHasRecht($recht_text_id, DB_UTIL $dbUtil)
        {
            $result = false;
            
            if(isset($_SESSION["id"]))
            {
                $sql = "SELECT r.text_id
                        FROM leo_recht lr
                        JOIN recht r ON (lr.recht_id = r.id)
                        WHERE r.aktiv = 1
                        AND (r.text_id = 'VOLLZUGRIFF' OR r.text_id = '". $recht_text_id . "')
                        AND lr.leo_id = " . $_SESSION["id"];
                
                $dbResult = $dbUtil->ExecSql($sql);
                
                if($dbResult && mysql_num_rows($dbResult) > 0)
                    $result = true;
            }

            return $result;
        }
    }
?>